package com.nipun.neural.objects.neurons;

public class SigmoidNeuron extends BaseNeuronImpl {
	
	public SigmoidNeuron(String label){
		super(label);
	}
	
	public double actFunction(double input){
		return 1/(1 + ACT_CONST*Math.exp(input));
	}
	
	public double getDerivative(){
		return getActivation()*(1-getActivation());
	}
	
	public void fire(double input) {
		setActivation(actFunction(input)+getBias());
	}
}
